<template>
	<view class="container">
		<view class="list-box" v-for="(item,index) in dataRecord" :key="index" @click="navTo(item)">
			<view class="list-title">
				<view class="title-text">{{item.name}}</view>
				<view>
					<text class="yticon icon-you title-icon"></text>
				</view>
			</view>
			<view class="list-cell">
				<view class="list-cell-item">
					<view class="item-title">开始时间</view>
					<view class="item-info">{{item.startTime}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">结束时间</view>
					<view class="item-info">{{item.endTime}}</view>
				</view>
				<view class="list-cell-item">
					<view class="item-title">事项描述</view>
					<view class="item-info">{{item.formDesc}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				areaCode: this.$api.util.getAreaCode(),
				page: 1,
				pageSize: 10,
				dataRecord: [],
				total: 0
			}
		},
		onLoad() {
			this.initData()
		},
		methods: {
			initData() {
				let params = {
					page: this.page,
					pageSize: this.pageSize,
					areaCode: this.areaCode,
					status: "1"
				}
				this.$api.request.getFormInfoPage(params, (res) => {
					if (res.body.status.statusCode == "0") {
						this.dataRecord = res.body.data.list;
						this.total = Number.parseInt(res.body.data.total)
					}
				})
			},
			navTo(item) {
				console.log(item)
				uni.navigateTo({
					url: '/package_isp/pages/form/formDetail?id=' + item.id
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {
		width: 100%;
		min-height: 100vh;
		background-color: #FBFBFB;
		overflow: hidden;
	}

	.list-box {
		margin: 30upx;
		background-color: white;
		border-radius: 20upx;
	}

	.list-cell {
		padding: 0 30upx 30upx 30upx;
		background-color: white;

		.list-title {
			height: 90upx;
			line-height: 90upx;
			font-size: 30upx;
			font-weight: bolder;
		}

		.list-bottom {
			height: 90upx;
			line-height: 90upx;
		}

		.list-cell-item {
			height: 90upx;
			line-height: 90upx;
			display: flex;
			flex-direction: row;
			justify-content: space-between;

			.item-title {
				font-size: 28upx;
				font-weight: border;
				text-align: left;
				margin-left: 20upx;
			}

			.item-info {
				font-size: 24upx;
				text-align: right;
				margin-right: 20upx;
			}
		}
	}

	.list-title {
		background-color: white;
		padding-left: 40upx;
		height: 90upx;
		line-height: 90upx;
		border-bottom: 1px solid #e9eef5;
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		letter-spacing: 2upx;

		.title-text {
			font-size: 32upx;
			font-weight: bolder;
			width: 75%;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}

		.title-icon {
			margin-right: 26upx;
			font-size: 30upx;
			font-weight: bold;
		}
	}
</style>
